package com.feshfans;

public class Question7 {

    public int reverse(int x) {
        int n = 0;
        while (x != 0){
            if((n * 10) / 10 != n){
                return 0;
            }
            n = n*10 + x % 10;
            x = x / 10;
        }
        return n;
    }
}
